<?php
/**
 * Created by JetBrains PhpStorm.
 * User: dodasso
 * Date: 7/14/13
 * Time: 8:10 PM
 * To change this template use File | Settings | File Templates.
 */

define('APP_ROOT', realpath(__DIR__ . '/../..'));

require_once(APP_ROOT . '/modules/persistance/DBConnector.php');
require_once(APP_ROOT . '/modules/common/Errors.php');

use persistance\DBConnector;
use common\Errors;

function testConnect() {
    $dbconn = new DBConnector();
    $rs = $dbconn->connect();
    $dbconn->disconnect();

    print('testConnect(): ' .
        (($rs === Errors::INTEGRAL_ERR_NONE) ? 'OK' : 'FAIL') .
        PHP_EOL);
}

function testDisconnect() {
    $dbconn = new DBConnector();
    $dbconn->connect();
    $rs = $dbconn->disconnect();

    print('testDisconnect(): ' .
        (($rs === Errors::INTEGRAL_ERR_NONE) ? 'OK' : 'FAIL') .
        PHP_EOL);
}

testConnect();
testDisconnect();